//
//  SACollectionNoticeChildViewController.m
//  SunOn
//
//  Created by mc on 2017/5/5.
//  Copyright © 2017年 NeoZhang. All rights reserved.
//

#import "SACollectionNoticeChildViewController.h"

#import "SADepartmentCollectionTableViewCell.h"
#import "SASalesCollectionTableViewCell.h"

@interface SACollectionNoticeChildViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UITableView *tabview;

@end

@implementation SACollectionNoticeChildViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view addSubview:self.tabview];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//    if (self.type == 0) {
//    }else {
//    }
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//    if (self.type == 0) {
//    }else {
//    }
    return 5;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (self.type == 0) {
        SASalesCollectionTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SASalesCollectionTableViewCell" forIndexPath:indexPath];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.responsTitle.text = @"回复";
        [cell configureCellsImageHeight:0 CommentHeight:38];
        return cell;
    }else {
        SADepartmentCollectionTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SADepartmentCollectionTableViewCell" forIndexPath:indexPath];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        [cell configureCellsImageHeight:0 CommentHeight:38];
        [cell.huifuButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
        [cell.huifuButton setBackgroundColor:[UIColor colorWithHexString:@"#0084fd"]];
        return cell;
    }
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (self.type == 0) {
        return 89 + 44 + 7;
    }else {
        return 111 + 44 + 7;
    }
}
#pragma mark - setter&getter
- (UITableView *)tabview {
    if (!_tabview) {
        self.tabview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SASCREEN_WIDTH, SASCREEN_HEIGHT - 201) style:(UITableViewStylePlain)];
        self.tabview.delegate = self;
        self.tabview.dataSource = self;
        [self.tabview registerNib:[UINib nibWithNibName:@"SADepartmentCollectionTableViewCell" bundle:nil] forCellReuseIdentifier:@"SADepartmentCollectionTableViewCell"];
        [self.tabview registerNib:[UINib nibWithNibName:@"SASalesCollectionTableViewCell" bundle:nil] forCellReuseIdentifier:@"SASalesCollectionTableViewCell"];
        self.tabview.showsVerticalScrollIndicator = NO;
        self.tabview.showsHorizontalScrollIndicator = NO;
    }
    return _tabview;
}


@end
